import React, { Component } from 'react';
import {
  AppRegistry,
  Dimensions,
  Platform,
  NativeModules,
  DeviceInfo,
  StyleSheet,
  Image,
  Text,
  View,
  TextInput,
  PixelRatio,
  TouchableOpacity,
  ScrollView
} from 'react-native';
var Common = require('./common');
const pixelRatio = PixelRatio.get();
const dismissKeyboard = require('dismissKeyboard');
export default class MessageList extends Component<Props> {
  static navigationOptions = {
      headerTitle: '消息详情',
      tabBarLabel: '消息详情',

  };
  constructor(props){
    super(props);
    this.state = {

    };
  }

  login(){
    var _this = this;
    Common.ajaxPost(Common.url + 'login.php', function(res){
      if(res.code == "0000"){

      }
    }.bind(this), {verify:'08login',t:''});
  }

  toRegister(){
    this.props.navigation.navigate('Register')
  }



  getData(){
    var _this = this;
    Common.ajaxGet(Common.url + 'article.php?action=articlelist&caid=7&page=1&pagesize=10', function(res){
      console.log(res)
      if(res.code == 1){
        var data = res.data;

      }
    }.bind(this), {verify:'08login',t:''});
  }
  componentDidMount(){
    this.getData();
    // console.log(this.props.navigation.state.params)
    // if(this.props.navigation.state.params.from){
    //   this.setState({
    //     from:this.props.navigation.state.params,
    //   })
    // }
  }
  render() {
    const { navigate } = this.props.navigation;
    return (
      <View style={styles.container}>
        <View style={styles.messageTop}>
          <Text style={{fontSize:20,color:'rgb(27,27,27)',paddingBottom:8,}}>消息大标题</Text>
          <Text style={{fontSize:14,color:'rgb(177,177,177)'}}>2019-01-01 11:11:11</Text>
        </View>
        <View style={{height:8,backgroundColor:'#f5f5f5'}}></View>
        <View style={styles.messageBottom}>
          <Text style={{fontSize:16,color:'rgb(118,118,118)',lineHeight:24,}}>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</Text>
        </View>

      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    height:Common.screenHeight,
    backgroundColor: '#fff',
  },
  messageTop:{
    paddingTop:26,
    paddingBottom:26,
    paddingLeft:20,
    paddingRight:20,

  },
  messageBottom:{
    paddingTop:20,
    paddingBottom:20,
    paddingLeft:20,
    paddingRight:20,
  }

});
